package cn.wolfcode.trip.base.service.impl;

import cn.wolfcode.trip.base.domain.SystemMessages;
import cn.wolfcode.trip.base.mapper.SystemMessagesMapper;
import cn.wolfcode.trip.base.query.SystemMessagesQueryObject;
import cn.wolfcode.trip.base.service.ISystemMessagesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class SystemMessagesImpl implements ISystemMessagesService {
    @Autowired
    private SystemMessagesMapper systemMessagesMapper;

    @Override
    public void save(SystemMessages sm) {
        systemMessagesMapper.insert(sm);
    }

    @Override
    public void delete(Long id) {
        systemMessagesMapper.deleteByPrimaryKey(id);
    }

    @Override
    public List<SystemMessages> byAuthorId(SystemMessagesQueryObject qo ){

        return  systemMessagesMapper.selectAll(qo);
    }

    @Override
    public void update(SystemMessagesQueryObject qo) {
        systemMessagesMapper.updateByPrimaryKey(qo);
    }
}
